package huajiu.com.utlis;

import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;




public class JsonResultUtil {


	
	public static String objectToJson(Object obj) {
		return JSON.toJSONString(obj);
	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static Object jsonToObject(String json, Class clazz) {
		return JSON.parseObject(json, clazz);

	}

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static List<?> jsonToList(String json, Class clazz) {
		return JSONArray.parseArray(json, clazz);
	}

}
